<template>
  <div class="h-full w-full top-0 left-0 z-1000 absolute" v-if="newshow">
    <!-- <twoRe> </twoRe> -->
    <!-- <comone :componentData="componentData" :isComponentsDisabled="isComponentsDisabled" @on-save="onSave"
      @on-close="onClose">
    </comone> -->
    <component :is="tabs[isComponents]" :key="isComponents" :componentData="componentData"
      :isComponentsDisabled="isComponentsDisabled" @on-save="onSave" @on-close="onClose">
    </component>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
// import twoRe from './components/twoRe.vue'
import comone from './components/component.vue'

let newshow = ref(true) // 控制动态组件
// 动态组件
let tabs = {
  comone
}
let isComponents = 'comone' // 组件
let isComponentsDisabled = ref(false) // 组件查看编辑状态
let componentData = ref({
  name: '名称',
}) // 组件数据


// 组件保存后所触发
const onSave = () => {
  isComponentsDisabled.value = false
  console.log('组件保存后所触发')
}

// 组件关闭后所触发
const onClose = () => {
  isComponentsDisabled.value = false
  console.log('组件关闭后所触发')
}


</script>
